<?php
include("../lang/cn/company_type_config.php");

if(is_numeric($_GET['id']) && $_GET['id']>0){
	$sql = "select a.*,(select address from ".AFTERSALESADDRESS." where id=a.back_address) as address,(select pic from ".SETMEAL." where id=a.product_id) as product_pic,(select pid from ".SETMEAL." where id=a.product_id) as pid from ".AFTERSALES." a where id='{$_GET['id']}'";
	$db->query($sql);
	$de = $db->fetchRow();

	$de['status_text'] = $after_sale_status[$de['status']];
	if($pos=strpos($de['product_pic'], ',')!==false){
		$de['product_pic'] = strstr($de['product_pic'],",",true);
	}
	$de['after_sale_pic'] = explode(",", $de['pic']);
	
	$tpl->assign('de',$de);
	$tpl->display('after_sale_detail.htm');
}else{
	msg("?m=product&s=after_sale.php");
}